﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RedHouse.Data.Service;
using RedHouse.Data.Base;
using RedHouse.Data.Entities;

namespace RedHouse.Web
{
    public partial class Speciaties : System.Web.UI.Page
    {
        private IDishService _dishService;
        private ICategoryService _categoryService;
        public List<RedHouseDish> Dishes { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            Initialize();
        }

        private void Initialize()
        {
            _dishService = new DishService();
            _categoryService = new CategoryService();
            RedHouseCategory category  = _categoryService.GetCategoryByName("Specialties");
            Dishes = _dishService.GetAllDishByCategory(category.Id);
            rptDish.DataSource = Dishes;
            rptDish.DataBind();
        }
    }
}